//
//  MDHCommonSwitchItemViewModel.swift
//  JSTech
//
//  Created by 高得华 on 2019/5/8.
//  Copyright © 2020 华&梅. All rights reserved.
//

import UIKit


///带有开关按钮的ViewModel
class MDHCommonSwitchItemViewModel: MDHCommonValueItemViewModel {
    /// 开关状态
    @objc var off = false {
        didSet {
            MDHPreferenceSettingHelper.setBool(value: off, defaultName: self.key)
        }
    }
    
    ///key
    override var key: String {
        didSet {
            self.off = MDHPreferenceSettingHelper.boolForKey(defaultName: key)
        }
    }
}
